import http from "@/utils/fetch";

// 获取商品列表
export function getGoodsList(params) {
  return http.post("/Supplier/Goods/getGoodsList", params);
}
// 获取商户下所有申请品类
export function getShopCategory() {
  return http.get("/Supplier/Goods/getShopCategory");
}
// 获取商品添加各参数
export function getGoodsRentData() {
  return http.get("/Supplier/Goods/getGoodsRentData");
}
// 通过分类id获取商品参数
export function getGoodsParameter(id) {
  return http.post("/Supplier/Goods/getGoodsParameter", { cate_id: id });
}
// 添加商品基础信息
export function addGoodsData(params) {
  return http.post("/Supplier/Goods/addGoodsData", params);
}
// 套餐获取参数
export function getParameterList() {
  return http.get("/Supplier/Goods/getParameterList");
}
// 添加套餐信息
export function addSetmeal(params) {
  return http.post("/Supplier/Goods/addSetmeal", params);
}
// 获取设置活动
export function activityList() {
  return http.post("/Supplier/Goods/activityList");
}
// 设置活动
export function activityAdd(goods_id,activity_id) {
  return http.post("/Supplier/Goods/activityAdd", { goods_id: goods_id,activity_id: activity_id });
}
// 编辑获取商品基础信息
export function getGoodsData(id) {
  return http.get("/Supplier/Goods/getGoodsData", { goods_id: id });
}
// 编辑商品基础信息
export function editGoodsData(params) {
  return http.post("/Supplier/Goods/editGoodsData", params);
}
// 编辑获取商品套餐列表
export function getGoodsSetmealList(id) {
  return http.get("/Supplier/Goods/getGoodsSetmealList", { goods_id: id });
}
// 编辑获取套餐信息
export function getGoodsSetmealInfo(id) {
  return http.get("/Supplier/Goods/getGoodsSetmealInfo", { setmeal_id: id });
}
// 编辑套餐信息
export function editGoodsSetmeal(params) {
  return http.post("/Supplier/Goods/editGoodsSetmeal", params);
}
// 草稿箱商品列表
export function getGoodsDraft(params) {
  return http.get("/Supplier/Goods/getGoodsDraft", params);
}
// 草稿箱获取商品信息
export function getGoodsAndSetmeal(id) {
  return http.get("/Supplier/Goods/getGoodsAndSetmeal", { goods_id: id });
}
// 商品上架
export function goodsGrounding(id) {
  return http.post("/Supplier/Goods/goodsGrounding", { goods_id: id }, true);
}
// 商品下架
export function itemDownShelf(id) {
  return http.post("/Supplier/Goods/itemDownShelf", { goods_id: id }, true);
}
// 提交审核
export function goodsSubmitReview(id) {
  return http.post("/Supplier/Goods/goodsSubmitReview", { goods_id: id }, true);
}
// 删除商品
export function deleteGoods(id) {
  return http.post("/Supplier/Goods/deleteGoods", { goods_id: id }, true);
}
// 删除套餐
export function deleteGoodsSetmeal(params) {
  return http.post("/Supplier/Goods/deleteGoodsSetmeal", params, true);
}
// 获取套餐库存
export function getSetmealStock(id) {
  return http.get("/Supplier/Goods/getSetmealStock", { goods_id: id });
}
// 编辑套餐库存
export function editGoodsStock(params) {
  return http.post("/Supplier/Goods/editGoodsStock", params, true);
}
// 取消审核
export function goodsCancelReview(id) {
  return http.post("/Supplier/Goods/goodsCancelReview", { goods_id: id }, true);
}
// 批量删除草稿
export function batchDeleteGoodsDraft(id) {
  return http.post(
    "/Supplier/Goods/batchDeleteGoodsDraft",
    { goods_id: id },
    true
  );
}
// 商品分享
export function goodsShare(id) {
  return http.get("/Supplier/Goods/goodsShare", { goods_id: id });
}
// 查看商品详情
export function getGoodsInfo(id) {
  return http.get("/Supplier/Goods/getGoodsInfo", { goods_id: id });
}

// 采购商品列表
export function procureList(params) {
  return http.get("/Supplier/Procure/procureList", params,true);
}
// 采购商品列表需要数据
export function procureData() {
  return http.get("/Supplier/Procure/procureData");
}
// 外部请求采购商品列表
export function sendProcureList(params) {
  return http.get("/Supplier/Procure/sendProcureList", params,true);
}
// 采购单数据
export function procureApplyData() {
  return http.get("/Supplier/Procure/procureApplyData");
}
// 采购单数据
export function applyProcure(params) {
  return http.post("/Supplier/Procure/applyProcure", params,true);
}
// 外部请求采购商品撤回
export function sendProcureCancel(params) {
  return http.post("/Supplier/Procure/sendProcureCancel",params,true);
}